package com.qfmy.app.controller.novel;

import com.qfmy.app.service.novel.ReadTimeService;
import com.qfmy.common.result.Result;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 清风明月
 * @Package com.qfmy.app.controller.novel
 * @date 2025/4/15
 * @description 阅读时间
 */
@RestController
@RequestMapping("/app/readTime")
@SuppressWarnings("all")
public class ReadTimeController {

    /**
     * 注入service
     */
    @Resource
    private ReadTimeService readTimeService;

    /**
     * 获取一天的阅读时间
     */
    @RequestMapping("/getReadTime")
    public Result getReadTime(){
        Integer readTime = readTimeService.getReadTime();
        return Result.ok(readTime);
    }

    /**
     * 更新阅读时长
     */
    @RequestMapping("/updateReadTime")
    public Result updateReadTime(String readTime){
        readTimeService.updateReadTime(readTime);
        return Result.ok();
    }

}
